#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	FILE* pf = fopen("date.txt", "r");
	if (pf == NULL)
	{
		perror("fopen");
		return 1;
	}
	char arr[100] = { 0 };
	FILE* pl = fopen("data_copy.txt", "w");
	if (pl == NULL) 
	{
		perror("fopen");
		return 1;
	}
	int c;
	while ((c = fgetc(pf)) != EOF)
	{
		fputc(c, pl);
	}
	if (ferror(pf))
		puts("I/O error when reading");
	else if (feof(pf))
		puts("End of file reached successfully");
	fclose(pf);
	fclose(pl);
	pf = NULL;
	pl = NULL;
	return 0;
}